// struct1.c
// gcc struct1.c

#include <stdio.h>
#include <stdlib.h>

typedef struct Student
{
    char name[10];
    int  eng;
    int  math;
}STUDENT;


int main()
{
    STUDENT stu;
    printf("name : ");  gets(stu.name);
    printf("eng  : ");  scanf("%d",&stu.eng);
    printf("math : ");  scanf("%d",&stu.math);
    printf("\n");
    printf("sizeof(STUDENT) = %d byte(s)\n",sizeof(STUDENT));
    printf("\n");
    printf("Name\tEng\tMath\tSum\tAvg\n");
    printf("---------------------------------------\n");
    printf("%s\t%d\t%d\t%d\t%.2f\n", 
           stu.name, 
           stu.eng, 
           stu.math,
           stu.eng + stu.math,
           (stu.eng + stu.math) / 2.0 );
    printf("\n");
    system("pause");
    return 0;
}
